#include<stdio.h>
int main()
{
    int T,i,n,m,sum,j;
    scanf("%d",&T);
    
    for(j=1;j<=T;j++)
    {
        scanf("%d",&n);
        sum=0;
        for(i=1;i<=n;i++)
        {
            scanf("%d",&m);
            sum=sum+m;
        }
        printf("%d\n",sum);
    }
    return 0;
}
